
<?php include_once 'common/header.php';  ?>

<!-- admin_main -->
<div class="admin_main">
	<!-- Admin_top end -->
	<?php include_once 'common/system_left.php';  ?>
	<!-- Admin_Left End -->
	<div class="admin_right">
	<div class="admin_right_title"><strong>系统管理</strong> >> 修改管理员类型</div>
		<div class="admin_right_info">
		<div class="payonline_form">
			<form action="/ychadmin/systemadmin/admin_type_edit/" method="post" id="form" name="form"><input name="id" type=hidden value="<?php echo $id;?>">
			<ul>
				<li>
					<font color="red"><?php echo @validation_errors(); ?></font>
				</li>

				<li>
					<div class="admin_right_info_tr admin_right_info_l">管理类型名称：</div>
					<div class="admin_right_info_tr admin_right_info_m">
					<input type="text" name="name" id="name" size="50" value="<?php echo $name;?>" />
					</div>
					<div class="admin_right_info_tr admin_right_info_r"><div id="nameTip"></div></div>
				</li>
				<li>
					<div class="admin_right_info_tr admin_right_info_l">状态：</div>
					<div class="admin_right_info_tr admin_right_info_m">
				    <input type="radio" name="fstatus" value="1" <?php if($status==1) echo 'checked'?> />开通
					<input type="radio" name="fstatus" value="0" <?php if($status==0) echo 'checked'?>/>关闭
					</div>
					<div class="admin_right_info_tr admin_right_info_r"><div id="statusTip"></div> </div>
				</li>
				<li>
					<div class="admin_right_info_tr admin_right_info_l">描述说明：</div>
					<div class="admin_right_info_tr admin_right_info_m">
					<input type="text" name="remark" id="remark" size="50"  value="<?php echo $remark;?>" />
					</div>
					<div class="admin_right_info_tr admin_right_info_r"><div id="remarkTip"></div> </div>
				</li>
				<li>
					<div class="admin_right_info_tr admin_right_info_l">管理权限：</div>
					<div class="admin_right_info_tr admin_right_info_m">
					<?php
					$module_arr = explode(',',$module);
					foreach ($type as $k=>$v){
						echo "【".$v['name']."】";
						foreach($v['list'] as $lk => $lv){
							echo "<table border='0' cellspacing='1' cellpadding='0' bgcolor='#cfe6f4' width='100%'><tr><td  height='35' align='center' valign='middle' bgcolor='#F1F1F1' style='text-align: right;color: #0068b7;width: 15%;'>|---".$lv['sonname']."</td><td height='35' width='86%' align='left' valign='middle' bgcolor='#FFFFFF'>";
							foreach($lv['sonlist'] as $sk =>$sv){
				    ?>
					<input type="checkbox" name="module[]" id="module<?php echo $sk;?>" value="<?php echo $sk;?>" <?php if(array_key_exists(array_search($sk,$module_arr),$module_arr)) echo "checked"?>/>
					<?php
					         echo "&nbsp;&nbsp;".$sv['linkname']."&nbsp;";
							}
							echo "</td></tr></table>";
						}
					}
					?>
					</div>
					<div class="admin_right_info_tr admin_right_info_r"><div id="moduleTip"></div> </div>
				</li>
				
				<li>
					<div class="payment_btm">
						<input type="submit" value="提交"  class="btn_b"/>
					</div>
				</li>
			</ul>
			</form>
			</div>
			</div>
	</div>
<!-- Admin_Right End -->
</div>
<!-- admin_main end -->
<script type="text/javascript">
$(document).ready(function(){
	$.formValidator.initConfig({formID:"form",debug:false,submitOnce:true,
		onError:function(msg,obj,errorlist){
			$("#errorlist").empty();
			$.map(errorlist,function(msg){
				$("#errorlist").append("<li>" + msg + "</li>")
			});
			alert(msg);
		},
		submitAfterAjaxPrompt : '有数据正在异步验证，请稍等...'
	});
    $("#name").formValidator({autoModify:true,onShow:"",onFocus:"类型名称在1-20个汉字之间",onCorrect:""}).inputValidator({min:1,max:40,onError:"类型名称不能为空,请确认"});
	$(":checkbox[name='module[]']").formValidator({tipid:"moduleTip",onShow:"请选择管理模块",onFocus:"你至少选择1个管理模块",onCorrect:"恭喜你,你选对了"}).inputValidator({min:1,onError:"请选择管理权限"}); 
});
</script>
<div id="dialog" title="系统提示" style="display:none"><p id="msg" style="text-align:center"></p></div>
</body>
</html>